#pragma once

#include "Request.h"
#include <queue>

using std::queue;

#define NUM_RESOURCE_TYPES 3

class Manager
{
protected:
	HANDLE m_hQueueSemaphore;
	HANDLE m_hQueueChangeEvent;
	queue<Request*> m_qRequestQueues[NUM_RESOURCE_TYPES];
	bool m_bNoResources;

public:
	Manager();
	~Manager();

	bool GetResource(unsigned int index);
	void AccessQueue();
	void ExitQueue();
	void ExitQueueAndWaitForChange();
	Request* GetRequestFromQueue(int iResourceIndex);
	void CancelWaitForQueueChange();
};

